home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: HELP. How to convert '0x12' into FF char?
- Date: Wed, 20 Mar 96 17:56:54 GMT
- Organization: none
- Distribution: world
- Message-ID: <827344614snz@genesis.demon.co.uk>
- References: <4iissm$s76@nntp.ucs.ubc.ca> <17MAR199623533662@erich.triumf.ca>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <17MAR199623533662@erich.triumf.ca>
- bennett@erich.triumf.ca "P.Bennett" writes:
-
- >In article <4iissm$s76@nntp.ucs.ubc.ca>, gordonw@unixg.ubc.ca (Gordon Wong)
- > writes...
- >>Let's say we have d='1' and e='2' and the following code segment:
- >
- >>f='0x';
- >>strcpy(f,d);
- >>strcpy(f,e);
- >>
- >>f now contains the string '0x12' right?
- >
- >No.
-
- Indeed, it isn't even legal code.
-
- >but if you have:
- > char f[10] = "0x";
- > char d[2] = "1";
- > char e[2] = "2";
- > strcpy(f,d);
- > strcpy(f,e);
-
- I assume you mean strcat() here.
-
- >f will then contain the string "0x12".
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-